package cn.jwm.login.controller;

import cn.jwm.login.dto.LoginDTO;
import cn.jwm.login.service.loginService;
import cn.jwm.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 */
@RestController
public class LoginController {

    @Autowired
    private loginService loginService;

    public AjaxResult login(LoginDTO loginDTO){
        try {
            return loginService.login(loginDTO);
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.me().setSuccess(false).setMessage("登录失败!"+e.getMessage());
        }
    }
}
